package registe.untill.httpDataUntill;

import org.json.JSONObject;
import org.springframework.web.client.RestTemplate;
import registe.untill.baseUntill.RespCodeBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URI;

/**
 * Created by zhoumeineng on 2018/1/25.
 */
public class HttpDataUntill {
    public static JSONObject httpRspSet(HttpServletRequest req, HttpServletResponse rsp){
        rsp.addHeader("Access-Control-Allow-Origin", "*");
        rsp.setContentType("application/json;charset=UTF-8");
        return   new JSONObject(req.getParameter("message"));
    }
    public static void ErrorMessageBody(RestTemplate template,String code,String url){
         String respDesc =  template.getForObject(URI.create(url+code),String.class);
         RespCodeBody respCodeBody = new RespCodeBody();
    }
}
